package com.xtc.ql00045.frame1.model;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.model.Response;
import com.xtc.ql00045.frame1.bean.TestBean;
import com.xtc.ql00045.frame1.contract.TestContract;
import com.xtc.ql00045.frame1.untils.JsonCallback;


public class TestModel implements TestContract.Model {


    @Override
    public void httpData(HttpParams httpParams, TestContract.Presenter presenter) {
        OkGo.<TestBean>get("http://api.juheapi.com/japi/toh")
                .tag(this)
                .params(httpParams)
                .execute(new JsonCallback<TestBean>() {
                    @Override
                    public void onSuccess(Response<TestBean> response) {
                        presenter.getData(response.body());
                    }
                });
    }

}
